<form {{action "save" on="submit"}}>
  <fieldset>
    <legend>Add SSH public key</legend>

    <div {{bind-attr class="showNameError:has-error :form-group"}}>
      <label class="control-label">Name</label>
      {{input
        value=pubkey.name
        placeholder="Who's key is this"
        classNames="form-control Pubkey-form__name"}}
    </div>

    <div {{bind-attr class="showPubkeyError:has-error :form-group"}}>
      <label class="control-label">Public key</label>
      <p class="help-block">
        Copy and paste your public key here. This is usually in your home folder
        under <em>~/.ssh/id_rsa.pub</em>.
      </p>
      {{textarea
        value=pubkey.pubkey
        rows="10"
        classNames="form-control Pubkey-form__pubkey"}}
    </div>

    <div class="form-group">
      <input type="submit" value="Add"
        class="btn btn-primary Pubkey-form__save" />

      {{#if cancelRoute}}
        {{link-to "Cancel" cancelRoute
          classNames="btn btn-default Pubkey-form__cancel"}}
      {{else}}
        <a href="#" {{action "cancel"}}
          class="btn btn-default Pubkey-form__cancel">Cancel</a>
      {{/if}}
    </div>

  </fieldset>
</form>
